library(tidyverse)
library(plotly)
lq <- read_csv("life_quality.csv")
make sure you have two separate arguments
one to specify which column to use for coloring
the other to specify the colors
You may use this pallete for colouring continents.
colors <- c("#e41a1c", '#377eb8', '#4daf4a', '#984ea3', '#ff7f00')size by population
adjust size
you may consider adding the following arguments in plot_ly()
fill = ~'',
marker = list(
sizemode = "diameter",
opacity = 0.6,
line = list(
width = 1,
color = 'white'
)add an appropriate title
add an appropriate legend
add an appropriate x and y axis
for adding the source, you may consider using the code below:
annotations <- list(
x = 1.2, y = -0.1,
text = "Source: World Bank",
showarrow = F, xref = "paper", yref = "paper",
xanchor = "right", yanchor = "auto", xshift = 0, yshift = 0,
font = list(size = 12)
)